home *** CD-ROM | disk | FTP | other *** search
- class disney.rabbitRivalry.ui.Screen
- {
- var __mc;
- var ui;
- var __outroCallbackID;
- var __outroCallbackPath;
- var __isOpening;
- var __isClosing;
- var __isClosed;
- var __INTRO_FRAME = "intro";
- var __OUTRO_FRAME = "outro";
- var __HAS_INTRO = false;
- var __HAS_OUTRO = false;
- var __OPENED_FRAME = 10;
- var DOES_UPDATE = true;
- function Screen(mc, t_ui)
- {
- this.__mc = mc;
- this.ui = t_ui;
- this.__outroCallbackID = this.__outroCallbackPath = "";
- }
- function update(dt)
- {
- if(this.__isOpening)
- {
- if(this.__mc._currentFrame >= this.__OPENED_FRAME)
- {
- this.onOpened();
- }
- }
- else if(this.__isClosing)
- {
- if(this.__mc._currentFrame == this.__mc._totalFrames)
- {
- this.onClosed();
- }
- }
- }
- function init()
- {
- this.__isOpening = this.__isClosing = false;
- this.__isClosed = true;
- }
- function open()
- {
- this.__isClosed = false;
- if(this.__HAS_INTRO)
- {
- this.__isOpening = true;
- this.__mc.gotoAndPlay(this.__INTRO_FRAME);
- }
- else
- {
- this.onOpened();
- }
- }
- function onOpened()
- {
- this.__isOpening = false;
- this.__mc.gotoAndStop(this.__OPENED_FRAME);
- }
- function close()
- {
- if(this.__isClosed)
- {
- this.ui.onScreenClosed();
- return undefined;
- }
- if(this.__HAS_OUTRO)
- {
- this.__isClosing = true;
- this.__mc.gotoAndPlay(this.__OUTRO_FRAME);
- }
- else
- {
- this.onClosed();
- }
- }
- function onClosed()
- {
- this.__isClosing = false;
- this.__isClosed = true;
- if(this.__outroCallbackID != "")
- {
- smashing.keithm.Messenger.sendMessage(this.__outroCallbackPath,this.__outroCallbackID);
- this.__outroCallbackID = this.__outroCallbackPath = "";
- }
- else
- {
- this.ui.onScreenClosed();
- }
- }
- function closeThenCallback(callbackPath, callbackID)
- {
- this.__outroCallbackPath = callbackPath;
- this.__outroCallbackID = callbackID;
- this.close();
- }
- function makeButton(mc)
- {
- mc.screen = this;
- }
- function onMessageReceived(message, args)
- {
- this[message](args);
- }
- function toString()
- {
- return "Screen";
- }
- }
-